package com.zbkj.common.exception;

/**
 *  Exception 拦截
 * +----------------------------------------------------------------------
 * | Author:  
 * +----------------------------------------------------------------------
 */
public enum ExceptionCodeEnum implements ExceptionHandler{
    // 数据操作错误定义
    SUCCESS(200, "操作成功"),
    FAILED(500, "操作失败"),
    PRAM_NOT_MATCH(400, "参数不正确"),
    VALIDATE_FAILED(400, "参数检验失败"),
    UNAUTHORIZED(401, "未登录或token过期，请登录！"),
    FORBIDDEN(403, "没有相关权限"),
    NOT_FOUND(404, "没有找到相关数据"),
    ERROR(500, "系统异常"),
    WHITE_ERROR(408, "未在白名单中"),
    UN_REAL_NAME_ERROR(409, "未实名认证"),

    AUTHO_APPID_ERROR(600,"授权的appid无效"),
    UN_AUTHO_ERROR(601,"未经过认证,无法访问"),
    AUTHO_SIGN_ERROR(602,"签名错误"),
    AUTHO_UID_ERROR(603,"用户uid与授权令牌不匹配"),
    AUTHO_IP_ERROR(604,"请求IP未授权，访问受限"),
    ACCESS_TOKEN_ERROR(605,"未登录授权或授权已过期"),

    /**
     * 客户端输入密码错误提示
     */
    PROJECT_PWD_ERROR(800,"导出密码错误，剩余错误次数%s次"),

    PROJECT_STATUS_ERROR(900,"项目状态已变更，请刷新后重试"),

    NEED_RECHARGE_ERROR(1000,"流量包不足提示");
    ;

    private long code;
    private String message;

    ExceptionCodeEnum(long code, String message){
        this.code = code;
        this.message = message;
    }

    @Override
    public long getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
